% PERFORMANCE
% INPUT
% p - predictions
% y - labels
% method - performance metric, currently accuracy and error are implemented
%
% OUTPUT
% res - performance
function [res] = performance(p,y,method)
	
	% I assume labels are 1 and -1
	p(p >= 0) = 1;
	p(p <  0) = -1;
	
	if strcmp(method,'acc')
		res = sum(p == y)/length(y);
	elseif strcmp(method,'err')
		res = 1-(sum(p==y)/length(y));
	else
		error('That performance metric is not currently implemented.');
	end
	
end